<?php 
include("header.php");
include("fileop.php");
?>

<DIV id="prepage" style="font-family:arial; font-size:20; left:40%; top:0px; background-color:white; layer-background-color:white; height:100%; width:100%;"> 
<TABLE width=100%><TR><TD align="center"><img src="images/bluespinner.gif"  height="42" width="42"/></TD></TR><TR><TD align="center"><font size="4."><B>Deleting ... ... Please wait!</B></font></TD><TD></TD></TR></TABLE>
</DIV>



<?php

$resto_id = $_POST["selectedid"];
delete_pic_by_id($resto_id);

$con=mysqli_connect(DBADDR,DBUSER,DBPWD,DBNAME);
mysql_query('set names utf8'); 
// Check connection
if (mysqli_connect_errno()){
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  echo "Returning in 5 seceonds";
  header("refresh:5;url=allresto.php");
}


mysqli_query($con,"DELETE FROM info_resto WHERE RESTO_ID='".$resto_id."'");

mysqli_close($con);


header("Location:allresto.php?succ=1&type=d");


?>